#ifndef _OperationLevel_H_
#define _OperationLevel_H_

#include <wiisprite.h>
#include <vector.h>
#include "ComplexSprite.h"

using namespace wsp;

class OperationLevel {

   public:
      OperationLevel();
      ~OperationLevel();

      //return true on good level load
      bool LoadLevel(const char* level_config_file);

      void InitLevel(bool reset_bone);
      void EndLevel();
      void Draw(f32 zoom_val);

      //return true if bone is at level end;
      bool Update(Sprite* tweezer, bool isGrabbing);

      void RotateBone(f32 d_angle){bone.SetRotation(bone.GetRotation()+d_angle);} 
      void MoveBone(f32 dx, f32 dy){bone.Move(dx,dy);}       

      bool IsBonePinched(){return grab_state;}
      bool IsCollision(){return collision_state;}
      bool IsWon(){return level_won;}
      bool IsLevelRunning(){return level_running;}

      std::string GetTitle(){return title;}
      std::string GetDescription(){return description;}

   private:
      void Cleanup();
  
      Image bone_img;
      Image home_img;
      Image wall_img;

      f32 bone_start_x;
      f32 bone_start_y;
      f32 bone_start_rotation;

   //   ComplexSprite* bone;
      Sprite bone;
      Sprite home;
      //std::vector<ComplexSprite*> wall_list;
	  std::vector<Sprite*> wall_list;

      std::string title;
      std::string description;

      bool collision_state;
      bool grab_state;
      bool level_won;
      bool level_running;
};

#endif //_OperationLevel_H_
